ntp.conf:
  file.managed:
    - name: /etc/ntp.conf
{% if grains['host'] == 'vm-ystdns-2' or  grains['host'] == 'vm-ystdns-1'  %}
    - source: salt://ntp_conf/ntp_server.conf
{% else  %}
    - source: salt://ntp_conf/ntp_client.conf
{% endif %}
    - requires:
      - file: step-tickers.conf

step-tickers.conf:
  file.managed:
    - name: /etc/ntp/step-tickers
{% if grains['host'] != 'vm-ystdns-2' or  grains['host'] != 'vm-ystdns-1'  %}
    - source: salt://ntp_conf/step-tickers
{% endif %}

ntpd_service:
  cmd.run:
    - names:
      - /sbin/chkconfig ntpd on
    - requires:
      - file: ntp.conf

  service.running:
    - name: ntpd
    - enable: True
    - restart: True
    - watch:
      - file: /etc/ntp.conf
